using I2.Loc;
using UnityEngine;

public class TutChooseGun : TutorialBase
{
	public bool switchWeaponComplete;

	private SlotSelector slotSelector;

	private TutorialButton btnSwitchWeapon;

	public override void OnStart()
	{
		base.OnStart();
		btnSwitchWeapon = TutorialManager.instance.GetTutorialButtonById(TutorialButtonId.switchWeapon);
		GameController.instance.playerScript.weaponManager.switchWeapon("rifles", "Tutorial_Famas", string.Empty);
		StepStart();
		TutorialManager.instance.stepTutorialForFlurry = "6 Choose gun";
	}

	public override void OnStop()
	{
		BCWDebug.Log("OnStop TutChooseGun");
		isStarted = false;
		HideText();
		if (base.gameObject != null)
		{
			Object.Destroy(base.gameObject);
		}
	}

	public override void OnUpdate()
	{
		if (!switchWeaponComplete && GameController.instance.playerScript.weaponManager.currentWeaponScript.name == "Tutorial_Famas")
		{
			switchWeaponComplete = true;
			OnComplete();
		}
	}

	private void StepStart()
	{
		ShowText(ScriptLocalization.Get("Tutorial/src_Tutorial_ChooseGun"), 0f, true);
		TutorialManager.instance.PlayAnimButton(TutorialButtonId.switchWeapon);
	}

	public override void OnComplete()
	{
		TutorialManager.instance.tony.SetTarget(GameController.instance.playerScript.transform);
		slotSelector = Object.FindObjectOfType<SlotSelector>();
		slotSelector.blocked = true;
		btnSwitchWeapon.SetBlock(true);
		base.OnComplete();
	}
}
